import { lazy } from "react";

// 一级路由
const Login = lazy(() => import('../pages/Login/Login'))
const Layout = lazy(() => import('../pages/Layout/Layout'))
// 二级路由
const Create = lazy(() => import('../pages/Create/Create'))
const Al = lazy(() => import('../pages/Al/Al'))
const Draft = lazy(() => import('../pages/Draft/Draft'))
const AlDesign = lazy(() => import('../pages/AlDesign/AlDesign'));
const AlMatting = lazy(() => import('../pages/AlMatting/AlMatting'));
const ImageEdit = lazy(() => import('../pages/ImageEdit/ImageEdit'));
const Material = lazy(() => import('../pages/Material/Material'));
const MySpace = lazy(() => import('../pages/MySpace/MySpace'));
const Open = lazy(() => import('../pages/Open/Open'));
const Openlocal = lazy(() => import('../pages/OpenIocal/Openlocal'));

const Design = lazy(() => import('../pages/AlDesign/AlDesign'));
const Painting = lazy(() => import('../pages/Painting/Painting'));
const Materials = lazy(() => import('../pages/Material/Material'));
const Copywriting = lazy(() => import('../pages/Copywriting/Copywriting'));
const children = [
    {
        path: '/layout/create',
        element: <Create />,
    },
    {
        path: '/layout/al',
        element: <Al />,

    },
    {
        path: '/layout/draft',
        element: <Draft />,
    },
    {
        path: '/layout/almatting',
        element: <AlMatting />,
    },
    {
        path: '/layout/imageedit',
        element: <ImageEdit />,
    },
    {
        path: '/layout/material',
        element: <Material />,
    },
    {
        path: '/layout/myspace',
        element: <MySpace />,
    },
    {
        path: '/layout/open',
        element: <Open />,
    },
    {
        path: '/layout/openlocal',
        element: <Openlocal />,
    },
    {
        path: '/aldesign/design',
        element: <Design />,
    },
    {
        path: '/aldesign/painting',
        element: <Painting />,
    },
    {
        path: '/aldesign/materials',
        element: <Materials />,
    },
    {
        path: '/aldesign/copywriting',
        element: <Copywriting />,
    }
]
// const childrens = [
//     {
//         path: '/aldesign/design',
//         element: <Design />,
//     },
//     {
//         path: '/aldesign/painting',
//         element: <Painting />,
//     },
//     {
//         path: '/aldesign/materials',
//         element: <Materials />,
//     },
//     {
//         path: '/aldesign/copywriting',
//         element: <Copywriting />,
//     }
// ]
const router = [
    {
        path: '/login',
        element: <Login />,
    },
    {
        path: '/aldesign',
        element: <AlDesign />,
        children: [
            {
                path: '/aldesign/design',
                element: <Design />,
            },
            {
                path: '/aldesign/painting',
                element: <Painting />,
            },
            {
                path: '/aldesign/materials',
                element: <Materials />,
            },
            {
                path: '/aldesign/copywriting',
                element: <Copywriting />,
            }
        ]
    },
    {
        path: '/',
        element: <Layout />,
        children: children
    }

]
export default router